lect20

lect20 - NAME ORG DW jump_test 0FFFEh main In C: int B[7];...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
NAME jump_test ORG 0FFFEh DW main ORG 0200h //reserve space for seven 16 bit words labeled B In C: int B[7]; B DS16 7 // declare an 8-bit variable called sz and assign it the value 7 sz DB 7 // In C: char sz=7; foo DS8 1 // reserve space for 1 byte labeled foo. In C: char foo; ;This program tests how some of the conditional jumps behave RSEG CODE main mov #0A00h,SP mov.b #7, sz ; byte labeled sz = 7 mov #300h, R6 ; 300h signed or unsigned mov #200h, R7 tt cmp R6, R7 ; compute dest-src (R7-R6) and set status flags JEQ equl ; jump when dest = src (R7 = R6) JGE geq ; jump when signed dest >= src (R7 >= R6) ; but will only get here if dest != src JL less ; jump when signed dest < src (R7 < R6) less MOV #200h, R6 jmp tt equl MOV #100h, R6 jmp tt ; Now consider operands have different decimal equivalents whether ; they are considered to be signed or unsigned ; The fact that we are using JGE and JL means we are considering ; the data to be signed! If we were considering these data to be ; unsigned we would use the JHS and JLO
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

lect20 - NAME ORG DW jump_test 0FFFEh main In C: int B[7];...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online