•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 456,572 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,636 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 3021 | Replies: 2
![]() |
•
•
Join Date: Aug 2004
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
I'm stuck on retrieving bytes from a register using qbasic, specifically how do they get the Low byte and High byte from this:
'al%=lowbyte of ax, al%=highbyte of ax,
al%=outregs.ax and &hff
ah%=outregs.ax \ 256
I can understand that with call interrupt you can read or write to general registers but what i'm confused with is what are the '&HFF' and \ 256 for? aren't the registers already set, why the need to alter the value with these?
does outregs.ax equal one 16bit number and these two things seperate out the low byte and high byte, help i'm confused with this.
'al%=lowbyte of ax, al%=highbyte of ax,
al%=outregs.ax and &hff
ah%=outregs.ax \ 256
I can understand that with call interrupt you can read or write to general registers but what i'm confused with is what are the '&HFF' and \ 256 for? aren't the registers already set, why the need to alter the value with these?
does outregs.ax equal one 16bit number and these two things seperate out the low byte and high byte, help i'm confused with this.
•
•
Join Date: May 2004
Location: OK
Posts: 40
Reputation:
Rep Power: 5
Solved Threads: 0
•
•
•
•
Originally Posted by The Beholder
I'm stuck on retrieving bytes from a register using qbasic, specifically how do they get the Low byte and High byte from this:
'al%=lowbyte of ax, al%=highbyte of ax,
al%=outregs.ax and &hff
ah%=outregs.ax \ 256
I can understand that with call interrupt you can read or write to general registers but what i'm confused with is what are the '&HFF' and \ 256 for? aren't the registers already set, why the need to alter the value with these?
does outregs.ax equal one 16bit number and these two things seperate out the low byte and high byte, help i'm confused with this.
&hFF is 255 in hexadecimal (base 16)
I suggest you look up and in the help
outregs.ax does represent 1 16bit register (as with also bx,cx, etc)
You are not altering the registers but rather getting the high 8 bits and low
8 bits into separate variables. AH% and AL%
Others can probably explain some of this better than I can though I have used call interrupt a lot.
•
•
Join Date: Aug 2004
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
Originally Posted by Buff
&hFF is 255 in hexadecimal (base 16)
I suggest you look up and in the help
outregs.ax does represent 1 16bit register (as with also bx,cx, etc)
You are not altering the registers but rather getting the high 8 bits and low
8 bits into separate variables. AH% and AL%
Others can probably explain some of this better than I can though I have used call interrupt a lot.
Okay so then I was right outregs.ax is represents a 16bit register although I can use al%=outregs.ax and &HFF to get the value i need I would like to understand the math, how do we get the highbyte simply by using the bitwise operator with &HFF?
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- problems with reading random access line from a file (C++)
- VB 6.0. Creating a file for random access (Visual Basic 4 / 5 / 6)
- registration (ASP.NET)
- Lingering problems with Hotoffers, limited net access (Viruses, Spyware and other Nasties)
- Register Windows File (Windows NT / 2000 / XP / 2003)
- Hotmail & Yahoo Access Problem on WLAN (Networking Hardware Configuration)
- Access Web Database? (Database Design)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Message boxes
- Next Thread: FIeld width zero?


Linear Mode