Write a subroutine called VALDIGIT, which will determine if the ASCII code contained in the lower byte of AL is a digit from "O" to "9." If so, simply return. If not, jump to ERROR.
Added by Kenneth M.
Step 1
The ASCII code for '0' is 48 (0x30) and for '9' is 57 (0x39). Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 54 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a program that checks the initial value in memory location x4000 to see if it is a valid ASCII code. If it is a valid ASCII code,
Akash M.
Opcode (Hexadecimal) Mnemonic Description 0 HLT Halt 1 LDA Load ACC with M[MEM] 2 STA Store ACC in M[MEM] 3 ADD Add M[MEM] to ACC 4 TCA ACC-ACC + M[MEM] 5 BRU Branch unconditional 6 BIP Branch if ACC > 0 7 BIN Branch if ACC < 0 8 RWD Read a word into ACC 9 WWD Write a word from ACC A SHL Shift left ACC once B SHR Shift right ACC once C LDX INDEX - M[MEM] D STX M[MEM] - INDEX E TIX Test index increment F TDX Test index decrement a Most significant 4 bits of opcode only. Bit 11 is 0. b MEM refers to a memory word; that is, the symbolic address of a memory word. M[MEM] refers to the contents of the memory word MEM when used as a source and to the memory word when used as a destination. INDEX refers to one of the three index registers
Adi S.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD