OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Apr 28, 2024 1:54 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: subroutine not working
PostPosted: Mon Sep 18, 2023 9:19 pm 
Offline

Joined: Tue Nov 22, 2022 6:55 pm
Posts: 2
i have a simple character write subroutine that looks like
Code:
writeChar:
    mov ah, 0x0A
    mov bh, 0x00
    mov cx, 1
    int 0x10
    ret

before i call the function i put the value for ascii A into al then i call it but it doesnt do anything, when i copy the code inplace of the call it work just fine, what could be causing this


Top
 Profile  
 
 Post subject: Re: subroutine not working
PostPosted: Mon Sep 18, 2023 11:56 pm 
Offline
Member
Member

Joined: Sat Mar 10, 2018 10:16 am
Posts: 296
what about posting all your code?

_________________
https://github.com/VendelinSlezak/BleskOS


Top
 Profile  
 
 Post subject: Re: subroutine not working
PostPosted: Tue Sep 19, 2023 8:11 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1605
I second Klakap's request for the full code, but in this case I presume you failed to set up a stack.

_________________
Carpe diem!


Top
 Profile  
 
 Post subject: Re: subroutine not working
PostPosted: Tue Sep 19, 2023 8:18 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
My crystal ball says you moved the subroutine under a "bits 32" directive (or whatever is equivalent for your assembler).


Top
 Profile  
 
 Post subject: Re: subroutine not working
PostPosted: Tue Sep 19, 2023 8:49 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4597
Location: Chichester, UK
There are so many things that you could have done wrong. Single-stepping your code in a debugger should make the cause obvious.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group