Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a assembly program(in TASM only) Given string \"Pakistan\" If user enters

ID: 3796650 • Letter: W

Question

Write a assembly program(in TASM only) Given string "Pakistan" If user enters P 1 is displayed on screen if user enters a 2 is displayed on screen likewise for k 3 is displayed on screen and if user enter someother alphabet that is not part of pakistan for example Z D or G etc 8 is displayed on screen as there are 8 characters in Pakistan Please write easiest program you can think off i am beginner. Use TASM syntax only as i am not familiar with syntax of other compilers Thanks :) Write a assembly program(in TASM only) Given string "Pakistan" If user enters P 1 is displayed on screen if user enters a 2 is displayed on screen likewise for k 3 is displayed on screen and if user enter someother alphabet that is not part of pakistan for example Z D or G etc 8 is displayed on screen as there are 8 characters in Pakistan Please write easiest program you can think off i am beginner. Use TASM syntax only as i am not familiar with syntax of other compilers Thanks :) Given string "Pakistan" If user enters P 1 is displayed on screen if user enters a 2 is displayed on screen likewise for k 3 is displayed on screen and if user enter someother alphabet that is not part of pakistan for example Z D or G etc 8 is displayed on screen as there are 8 characters in Pakistan Please write easiest program you can think off i am beginner. Use TASM syntax only as i am not familiar with syntax of other compilers Thanks :)

Explanation / Answer


readcharacter
LDR r0, =0xE000C014
LDRB r1, [r0]   
BIC r1, r1, #0xFFFFFFFE   
CMP r1, #0   
BEQ read_character
LDR r6, =register   
LDR r2, [r6]

;if 1 => read the byte from recieve register
;stop

output_character
LDR r0, =0xE000C014   
LDRB r1, [r0]   
BIC r1, r1, #0xFFFFFFDF
MOV r1, r1, LSR #4   
CMP r1, #0
BEQ output_character
LDR r6, =register
STR r2, [r6]
B read_character
LDMFD sp!, {lr}
BX lr

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote