CSE 322 Fall 2018 Lab 7

November 14, 2018

Problem #1 (Program listing 9.2, 9.3, 9.4) Decimal input output procedure //Solution .MODEL small .STACK 256 .DATA .CODE MAIN PROC mov ax,@data mov ds,ax call indec push ax mov ah, 2 mov dl, 0dh int 21h mov dl, 0ah int 21h pop ax call outdec Exit: mov ah,4Ch int 21h MAIN ENDP outdec proc push

Continue Reading

CSE 322 Fall 2018 Lab 5

October 20, 2018

Problem #1 (Chapter 7 examples) Introduction to logical instructions //Solution mov ax, 01010101b mov bx, 10101010b ;And Instruction: Logical AND and the result is stored in the first register mov cx, ax and cx, bx ;OR Instruction: Logical OR and the result is stored in the first register mov cx, ax or cx, bx ;XOR

Continue Reading

CSE 322 Fall 2018 Lab 4

October 9, 2018

Problem #1 (Example 6.6) [AND condition] Read a character, and if it’s an uppercase letter, display it. //Solution mov ah, 1 int 21h cmp al, ‘A’ jl not_print cmp al, ‘Z’ jg not_print print: mov ah, 2 mov dl, al int 21h not_print: //Alternative COde mov ah, 1 int 21h cmp al, ‘A’ jge next

Continue Reading

CSE 322 Fall 2018 Lab 1

October 2, 2018

Problem #1 General structure of Assembly code and printing characters. //Solution .MODEL small .STACK 100h .DATA .CODE MAIN PROC mov ah, 2 mov dl, 41h int 21h mov dl, 0ah int 21h mov dl, 0dh int 21h mov dl, 41h int 21h ENDP MAIN end MAIN Proiblem #2 Input and output of characters //Solution .MODEL

Continue Reading

CSE 322 Summer 2018 Lab 11

August 23, 2018

Problem 1 (Chapter 10 question 9) Write a program that uses XLAT to (a) read a line of text, and (b)print It on the next line with all small letters converted to capitals. The Input line may contain any characters-small letters, capital, letters, digit characters, punctuation, and so on. //Code To be done by students

Continue Reading

CSE 322 Summer 2018 Lab 10

Problem 1 (section 10.7) Encoding and Decoding string using XLAT instruction //Code Title secret message .Model small .stack 100h .data ; ;ABCDEFGHIJKLMNOPQRSTUVWXYZ code_key db 65 dup(‘ ‘), ‘XQPOGHZBCADEIJUVFMNKLRSTWY’ db 37 dup(‘ ‘) ; ;ABCDEFGHIJKLMNOPQRSTUVWXYZ decode_key db 65 dup(‘ ‘), ‘JHIKLQEFMNTURSDCBVWXOPYAZG’ db 37 dup(‘ ‘) coded db 80 dup(‘$’) ; XQPO$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$4 prompt db ‘Enter a message

Continue Reading