Homework 8 Robert Wortman CpE 185 Mon / Wed Dennis Dahlquist November 14, 2011 1 Question 1 1.1 (a) PROG51.ASM(14) : warning A4012: line number information for segment without class CODE : cseg Instructions (code) must be in a segemnt that has a class name ending in "CODE". 1.2 (b) LINK : warning L4055: start address not equal to 0x100 for /TINY If no.model statement is given, the tiny memory model is assumed. For that memory model, the starting address must be 0x100. 1.3 (c) PROG51.ASM(20) : error A2006: undefined symbol : e00h In MASM, numbers must start with a decimal digit, even if the numbers are hexadecimal. There is something magnificently broken about this. 1
1.4 (d) No assembly or linking errors, but since it s calling interrupt 0a h instead of 10 h, the program doesn t print anything. 1.5 (e) PROG51.ASM(25) : error A2006: undefined symbol : IIIA Labels must be defined before they can be used as the destination for a jump. 1.6 (f) PROG51.ASM(28) : fatal error A1010: unmatched block nesting : cseg Holy crap. A helpful error message. Sort of. 1.7 (g) LINK : warning L4055: start address not equal to 0x100 for /TINY Haven t we been here before? It seems that MASM uses the END directive to specify a program entry point (i.e. the starting address). So, if none is specified, it does the wrong thing, and then complains about it. 1.8 (h) PROG51.ASM(28) : error A2046: missing single or double quotation mark in string PROG51.ASM(30) : error A2046: missing single or double quotation mark in string PROG51.ASM(32) : error A2046: missing single or double quotation mark in string PROG51.ASM(34) : error A2046: missing single or double quotation mark in string PROG51.ASM(36) : error A2046: missing single or double quotation mark in string PROG51.ASM(38) : error A2046: missing single or double quotation mark in string PROG51.ASM(40) : error A2046: missing single or double quotation mark in string PROG51.ASM(42) : error A2046: missing single or double quotation mark in string PROG51.ASM(44) : error A2046: missing single or double quotation mark in string 2
PROG51.ASM(46) : error A2046: missing single or double quotation mark in string PROG51.ASM(48) : error A2046: missing single or double quotation mark in string PROG51.ASM(50) : error A2046: missing single or double quotation mark in string PROG51.ASM(52) : error A2046: missing single or double quotation mark in string PROG51.ASM(54) : error A2046: missing single or double quotation mark in string PROG51.ASM(56) : error A2046: missing single or double quotation mark in string PROG51.ASM(58) : error A2046: missing single or double quotation mark in string PROG51.ASM(60) : error A2046: missing single or double quotation mark in string PROG51.ASM(62) : error A2046: missing single or double quotation mark in string PROG51.ASM(64) : error A2046: missing single or double quotation mark in string PROG51.ASM(66) : error A2046: missing single or double quotation mark in string PROG51.ASM(68) : error A2046: missing single or double quotation mark in string PROG51.ASM(70) : error A2046: missing single or double quotation mark in string PROG51.ASM(72) : error A2046: missing single or double quotation mark in string PROG51.ASM(74) : error A2046: missing single or double quotation mark in string PROG51.ASM(76) : error A2046: missing single or double quotation mark in string PROG51.ASM(78) : error A2046: missing single or double quotation mark in string PROG51.ASM(80) : error A2046: missing single or double quotation mark in string PROG51.ASM(82) : error A2046: missing single or double quotation mark in string PROG51.ASM(84) : error A2046: missing single or double quotation mark in string PROG51.ASM(86) : error A2046: missing single or double quotation mark in string PROG51.ASM(88) : error A2046: missing single or double quotation mark in string PROG51.ASM(90) : error A2046: missing single or double quotation mark in string PROG51.ASM(92) : error A2046: missing single or double quotation mark in string PROG51.ASM(94) : error A2046: missing single or double quotation mark in string PROG51.ASM(96) : error A2046: missing single or double quotation mark in string PROG51.ASM(98) : error A2046: missing single or double quotation mark in string PROG51.ASM(100) : error A2046: missing single or double quotation mark in string PROG51.ASM(102) : error A2046: missing single or double quotation mark in string PROG51.ASM(104) : error A2046: missing single or double quotation mark in string PROG51.ASM(106) : error A2046: missing single or double quotation mark in string PROG51.ASM(108) : error A2046: missing single or double quotation mark in string PROG51.ASM(110) : error A2046: missing single or double quotation mark in string PROG51.ASM(112) : error A2046: missing single or double quotation mark in string PROG51.ASM(114) : error A2046: missing single or double quotation mark in string PROG51.ASM(116) : error A2046: missing single or double quotation mark in string PROG51.ASM(118) : error A2046: missing single or double quotation mark in string PROG51.ASM(120) : error A2046: missing single or double quotation mark in string PROG51.ASM(122) : error A2046: missing single or double quotation mark in string PROG51.ASM(124) : error A2046: missing single or double quotation mark in string PROG51.ASM(126) : error A2046: missing single or double quotation mark in string PROG51.ASM(128) : error A2046: missing single or double quotation mark in string PROG51.ASM(130) : error A2046: missing single or double quotation mark in string PROG51.ASM(132) : error A2046: missing single or double quotation mark in string PROG51.ASM(134) : error A2046: missing single or double quotation mark in string PROG51.ASM(136) : error A2046: missing single or double quotation mark in string PROG51.ASM(138) : error A2046: missing single or double quotation mark in string PROG51.ASM(140) : error A2046: missing single or double quotation mark in string PROG51.ASM(142) : error A2046: missing single or double quotation mark in string PROG51.ASM(144) : error A2046: missing single or double quotation mark in string PROG51.ASM(146) : error A2046: missing single or double quotation mark in string 3
PROG51.ASM(148) : error A2046: missing single or double quotation mark in string PROG51.ASM(150) : error A2046: missing single or double quotation mark in string PROG51.ASM(152) : error A2046: missing single or double quotation mark in string PROG51.ASM(154) : error A2046: missing single or double quotation mark in string PROG51.ASM(156) : error A2046: missing single or double quotation mark in string PROG51.ASM(158) : error A2046: missing single or double quotation mark in string PROG51.ASM(160) : error A2046: missing single or double quotation mark in string PROG51.ASM(162) : error A2046: missing single or double quotation mark in string PROG51.ASM(164) : error A2046: missing single or double quotation mark in string PROG51.ASM(166) : error A2046: missing single or double quotation mark in string PROG51.ASM(168) : error A2046: missing single or double quotation mark in string PROG51.ASM(170) : error A2046: missing single or double quotation mark in string PROG51.ASM(172) : error A2046: missing single or double quotation mark in string PROG51.ASM(174) : error A2046: missing single or double quotation mark in string PROG51.ASM(176) : error A2046: missing single or double quotation mark in string PROG51.ASM(178) : error A2046: missing single or double quotation mark in string PROG51.ASM(180) : error A2046: missing single or double quotation mark in string PROG51.ASM(182) : error A2046: missing single or double quotation mark in string PROG51.ASM(184) : error A2046: missing single or double quotation mark in string PROG51.ASM(186) : error A2046: missing single or double quotation mark in string PROG51.ASM(188) : error A2046: missing single or double quotation mark in string PROG51.ASM(190) : error A2046: missing single or double quotation mark in string PROG51.ASM(192) : error A2046: missing single or double quotation mark in string PROG51.ASM(194) : error A2046: missing single or double quotation mark in string PROG51.ASM(196) : error A2046: missing single or double quotation mark in string PROG51.ASM(198) : error A2046: missing single or double quotation mark in string PROG51.ASM(200) : error A2046: missing single or double quotation mark in string PROG51.ASM(202) : error A2046: missing single or double quotation mark in string PROG51.ASM(204) : error A2046: missing single or double quotation mark in string PROG51.ASM(206) : error A2046: missing single or double quotation mark in string PROG51.ASM(208) : error A2046: missing single or double quotation mark in string PROG51.ASM(210) : error A2046: missing single or double quotation mark in string PROG51.ASM(212) : error A2046: missing single or double quotation mark in string PROG51.ASM(214) : error A2046: missing single or double quotation mark in string PROG51.ASM(216) : error A2046: missing single or double quotation mark in string PROG51.ASM(218) : error A2046: missing single or double quotation mark in string PROG51.ASM(220) : error A2046: missing single or double quotation mark in string PROG51.ASM(222) : error A2046: missing single or double quotation mark in string PROG51.ASM(224) : error A2046: missing single or double quotation mark in string PROG51.ASM(226) : error A2046: missing single or double quotation mark in string PROG51.ASM(228) : fatal error A1012: error count exceeds 100; stopping assembly Apparently, MASM thinks that s supposed to be a string. Apparently, MASM also thinks that there I have something north of 228 lines in my program, instead of only twentysomething. 4
2 Question 2 Listing 1: p52.asm cseg segment code assume cs : cseg, ds : cseg, s s : cseg, es : cseg org 100h ; l e a v e room f o r PSP s t a r t : mov ah, 00h ; r e q u e s t " s e t mode" f u n c t i o n mov al, 02h ; r e q u e s t mode 2 i n t 0ah ; c a l l video s e r v i c e s mov ax,0920 h ; r e q u e s t " w r i t e c h a r a c t e r " function, char space mov bl, 1 ah ; r e q u e s t a t t r i b u t e s blue bg, b r i g h t green f g mov cx, 0 7 d0h ; r e q u e s t repeat, 0x07d0 r e p e a t s i n t 10h ; c a l l video s e r v i c e s mov ah, 0 2 h ; r e q u e s t "move c u r s o r " f u n c t i o n mov dx, 0 a00h ; r e q u e s t row 0x0a, column 0x00 mov bh, 0 0 ; r e q u e s t page 0 i n t 10h ; c a l l video s e r v i c e s mov ah, 0 eh ; r e q u e s t d i s p l a y ASCII c h a r a c t e r mov al, 0 0 ; s e t c h a r a c t e r next : i n t 10h ; c a l l video s e r v i c e s i n c a l ; s e t next c h a r a c t e r cmp al, 8 0 h ; i s c h a r a c t e r past ASCII range jnz next ; i f not, go to next c h a r a c t e r i n t 20h ; i f so, return to DOS cseg end ends s t a r t Assembling the above program produced the following listing file: Microsoft (R) Macro Assembler Version 6.14.8444 11/14/11 16:33:12 Q52.ASM Page 1-1 0000 cseg segment code assume cs:cseg, ds:cseg, ss:cseg, es:cseg org 100h ; leave room for PSP 5
0100 start: 0100 B4 00 mov ah, 00h ; request "set mode" function 0102 B0 02 mov al, 02h ; request mode 2 0104 CD 0A int 0ah ; call video services 0106 B8 0920 mov ax,0920h ; request "write character" function, char space 0109 B3 1A mov bl,1ah ; request attributes blue bg, bright green fg 010B B9 07D0 mov cx,07d0h ; request repeat, 0x07d0 repeats 010E CD 10 int 10h ; call video services 0110 B4 02 mov ah,02h ; request "move cursor" function 0112 BA 0A00 mov dx,0a00h ; request row 0x0a, column 0x00 0115 B7 00 mov bh,00 ; request page 0 0117 CD 10 int 10h ; call video services 0119 B4 0E mov ah,0eh ; request display ASCII character 011B B0 00 mov al,00 ; set character 011D next: 011D CD 10 int 10h ; call video services 011F FE C0 inc al ; set next character 0121 3C 80 cmp al,80h ; is character past ASCII range 0123 75 F8 jnz next ; if not, go to next character 0125 CD 20 int 20h ; if so, return to DOS 0127 cseg ends end start Microsoft (R) Macro Assembler Version 6.14.8444 11/14/11 16:33:12 Q52.ASM Symbols 2-1 Segments and Groups: N a m e Size Length Align Combine Class cseg.............. 16 Bit 0127 Para Private CODE Symbols: N a m e Type Value Attr next.............. L Near 011D cseg 6
start............. L Near 0100 cseg 0 Warnings 0 Errors 7