Discussion Locked

Qbasic

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am able to access registers AX, BX, CX, and DX in qbasic. how do I access registers AL, BL, BH, and AH?

5 replies

by buckle

The AH and AL are respectively the High and Low byte of the AX register. So the "H" and "L" registers are one byte halves of the two byte "X" register. If you can get the "X" registers then you already have the "H" and "L" registers. Its been a while since I did any assembler so I can't remember which order they will be in but I think the "H" register will be first and the "L" register second, worth checking though.

by danpiers

The preceeding answer covered it very well, but for clarifications sake, a whole register (X) is 16-bits long (ofter called a word). The half register (Low or High) is one byte, or 8-bits long. The register contents is, of course, in binary, but on paper, it is often represented in 4-place hexadecimal (two places for the low side and two places for the high side). In assembly, the second byte in the word is usually the most significant portion, or the high byte. Hope this helps.

This discussion is closed to new replies.