Computer Systems and Assembly Language Input and output operations Eltayeb Abuelyaman CS233 Week # 15
Character Operations chari 0x000d,d chari 0x000e,d charo 0x000e,d charo 0x000d,d stop .block 1 .end
Input and Output Operations Determine the object code and predict the output of the following program DECO ‘m’,i CHARO ‘\n’,i DECO “mm”,i CHARO ‘\n’,I CHARO 0x0026,I STOP .END
Labels Determine the values of the symbols here and there and write the object code in hexadecimal BR there here: .word 9 there: DECO here,d STOP .END
An HLL program to compute modulo 16 of input numbers #include <isotream> Using namespace std; Int num; Int main() { cin >> num; remain = num %16; cout << “num = “” << endl; return 0; }
A program to compute Modulo a Number br start num: .block 1 result: .ASCII " sum = \X00" start: deci num,d lda num,d anda 0x000f,i sta num,d stro result,d deco num,d charo '\n',i stop .end
Stack Relative Addressing br reverse first: .word 'S' second: .word 'U' third: .word 'B' reverse: lda first,d stbytea -1,s lda second,d stbytea -2,s lda third,d stbytea -3,s subsp 3,i charo 0,s charo 1,s charo 2,s