我正在开发一个bootloader,我有一个bin文件,其汇编有点像这样..
-u 0 200
141A:0000 CD20 INT 20
141A:0002 FF9F009A CALL FAR [BX+9A00]
141A:0006 EE OUT DX,AL
141A:0007 FE1D CALL FAR [DI]
141A:0009 F0 LOCK
141A:000A 4F DEC DI
141A:000B 037E0E ADD DI,[BP+0E]
141A:000E 8A03 MOV AL,[BP+DI]
141A:0010 7E0E JLE 0020
141A:0012 17 POP SS
141A:0013 037E0E ADD DI,[BP+0E]
141A:0016 2904 SUB [SI],AX
141A:0018 0304 ADD AX,[SI]
141A:001A 0100 ADD [BX+SI],AX
141A:001C 02FF ADD BH,BH
141A:001E FFFF ??? DI
141A:0020 FFFF ??? DI
141A:0022 FFFF ??? DI
141A:0024 FFFF ??? DI
141A:0026 FFFF ??? DI
141A:0028 FFFF ??? DI
141A:002A FFFF ??? DI
141A:002C E40D IN AL,0D
141A:002E 4E DEC SI
141A:002F 013E1314 ADD [1413],DI
141A:0033 0018 ADD [BX+SI],BL
141A:0035 001A ADD [BP+SI],BL
141A:0037 14FF ADC AL,FF
141A:0039 FFFF ??? DI
141A:003B FF00 INC WORD PTR [BX+SI]
141A:003D 0000 ADD [BX+SI],AL
141A:003F 0005 ADD [DI],AL
141A:0041 0000 ADD [BX+SI],AL
141A:0043 0000 ADD [BX+SI],AL
141A:0045 0000 ADD [BX+SI],AL
141A:0047 0000 ADD [BX+SI],AL
141A:0049 0000 ADD [BX+SI],AL
141A:004B 0000 ADD [BX+SI],AL
141A:004D 0000 ADD [BX+SI],AL
141A:004F 00CD ADD CH,CL
141A:0051 21CB AND BX,CX
141A:0053 0000 ADD [BX+SI],AL
...
141A:007F 0001 ADD [BX+DI],AL
141A:0081 200D AND [DI],CL
141A:0083 65 DB 65
141A:0084 726E JB 00F4
141A:0086 65 DB 65
141A:0087 6C DB 6C
141A:0088 2E CS:
141A:0089 62 DB 62
141A:008A 69 DB 69
141A:008B 6E DB 6E
141A:008C 200D AND [DI],CL
141A:008E 204935 AND [BX+DI+35],CL
141A:0091 204431 AND [SI+31],AL
141A:0094 205033 AND [BX+SI+33],DL
141A:0097 3330 XOR SI,[BX+SI]
141A:0099 205433 AND [SI+33],DL
141A:009C 0D742E OR AX,2E74
141A:009F 65 DB 65
141A:00A0 7865 JS 0107
141A:00A2 0D0000 OR AX,0000
141A:00A5 0000 ADD [BX+SI],AL
141A:00A7 0000 ADD [BX+SI],AL
141A:00A9 0000 ADD [BX+SI],AL
141A:00AB 0000 ADD [BX+SI],AL
....
141A:00FB 0000 ADD [BX+SI],AL
141A:00FD 0000 ADD [BX+SI],AL
141A:00FF 00B8C007 ADD [BX+SI+07C0],BH
141A:0103 8ED8 MOV DS,AX
141A:0105 8EC0 MOV ES,AX
141A:0107 BE4F00 MOV SI,004F
141A:010A E8E800 CALL 01F5
141A:010D BE8F00 MOV SI,008F
141A:0110 E8E200 CALL 01F5
141A:0113 BFB500 MOV DI,00B5
141A:0116 E8E800 CALL 0201
141A:0119 BEB500 MOV SI,00B5
141A:011C 803C00 CMP BYTE PTR [SI],00
141A:011F 74EC JZ 010D
141A:0121 BEB500 MOV SI,00B5
141A:0124 BF9100 MOV DI,0091
141A:0127 E81C01 CALL 0246
141A:012A 7213 JB 013F
141A:012C BEB500 MOV SI,00B5
141A:012F BF9400 MOV DI,0094
141A:0132 E81101 CALL 0246
141A:0135 7210 JB 0147
141A:0137 BE7800 MOV SI,0078
141A:013A E8B800 CALL 01F5
141A:013D EBCE JMP 010D
141A:013F BE6300 MOV SI,0063
141A:0142 E8B000 CALL 01F5
141A:0145 EBC6 JMP 010D
141A:0147 BE9900 MOV SI,0099
141A:014A E8A800 CALL 01F5
141A:014D EBBE JMP 010D
141A:014F 57 PUSH DI
141A:0150 65 DB 65
141A:0151 6C DB 6C
141A:0152 63 DB 63
141A:0153 6F DB 6F
141A:0154 6D DB 6D
141A:0155 65 DB 65
141A:0156 20746F AND [SI+6F],DH
141A:0159 204D79 AND [DI+79],CL
141A:015C 204F53 AND [BX+53],CL
141A:015F 210D AND [DI],CX
141A:0161 0A00 OR AL,[BX+SI]
141A:0163 48 DEC AX
141A:0164 65 DB 65
141A:0165 6C DB 6C
141A:0166 6C DB 6C
141A:0167 6F DB 6F
141A:0168 204F53 AND [BX+53],CL
141A:016B 44 INC SP
141A:016C 65 DB 65
141A:016D 7620 JBE 018F
141A:016F 57 PUSH DI
141A:0170 6F DB 6F
141A:0171 726C JB 01DF
141A:0173 64 DB 64
141A:0174 210D AND [DI],CX
141A:0176 0A00 OR AL,[BX+SI]
141A:0178 42 INC DX
141A:0179 61 DB 61
141A:017A 64 DB 64
141A:017B 20636F AND [BP+DI+6F],AH
141A:017E 6D DB 6D
141A:017F 6D DB 6D
141A:0180 61 DB 61
141A:0181 6E DB 6E
141A:0182 64 DB 64
141A:0183 20656E AND [DI+6E],AH
141A:0186 7465 JZ 01ED
141A:0188 7265 JB 01EF
141A:018A 64 DB 64
141A:018B 2E CS:
141A:018C 0D0A00 OR AX,000A
141A:018F 3E DS:
141A:0190 006869 ADD [BX+SI+69],CH
141A:0193 006865 ADD [BX+SI+65],CH
141A:0196 6C DB 6C
141A:0197 7000 JO 0199
141A:0199 4D DEC BP
141A:019A 7920 JNS 01BC
141A:019C 4F DEC DI
141A:019D 53 PUSH BX
141A:019E 3A20 CMP AH,[BX+SI]
141A:01A0 43 INC BX
141A:01A1 6F DB 6F
141A:01A2 6D DB 6D
141A:01A3 6D DB 6D
141A:01A4 61 DB 61
141A:01A5 6E DB 6E
141A:01A6 64 DB 64
141A:01A7 733A JNB 01E3
141A:01A9 206869 AND [BX+SI+69],CH
141A:01AC 2C20 SUB AL,20
141A:01AE 68 DB 68
141A:01AF 65 DB 65
141A:01B0 6C DB 6C
141A:01B1 700D JO 01C0
141A:01B3 0A00 OR AL,[BX+SI]
141A:01B5 0000 ADD [BX+SI],AL
141A:01B7 0000 ADD [BX+SI],AL
141A:01B9 0000 ADD [BX+SI],AL
141A:01BB 0000 ADD [BX+SI],AL
141A:01BD 0000 ADD [BX+SI],AL
141A:01BF 0000 ADD [BX+SI],AL
141A:01C1 0000 ADD [BX+SI],AL
141A:01C3 0000 ADD [BX+SI],AL
141A:01C5 0000 ADD [BX+SI],AL
141A:01C7 0000 ADD [BX+SI],AL
141A:01C9 0000 ADD [BX+SI],AL
141A:01CB 0000 ADD [BX+SI],AL
141A:01CD 0000 ADD [BX+SI],AL
141A:01CF 0000 ADD [BX+SI],AL
141A:01D1 0000 ADD [BX+SI],AL
141A:01D3 0000 ADD [BX+SI],AL
141A:01D5 0000 ADD [BX+SI],AL
141A:01D7 0000 ADD [BX+SI],AL
141A:01D9 0000 ADD [BX+SI],AL
141A:01DB 0000 ADD [BX+SI],AL
141A:01DD 0000 ADD [BX+SI],AL
141A:01DF 0000 ADD [BX+SI],AL
141A:01E1 0000 ADD [BX+SI],AL
141A:01E3 0000 ADD [BX+SI],AL
141A:01E5 0000 ADD [BX+SI],AL
141A:01E7 0000 ADD [BX+SI],AL
141A:01E9 0000 ADD [BX+SI],AL
141A:01EB 0000 ADD [BX+SI],AL
141A:01ED 0000 ADD [BX+SI],AL
141A:01EF 0000 ADD [BX+SI],AL
141A:01F1 0000 ADD [BX+SI],AL
141A:01F3 0000 ADD [BX+SI],AL
141A:01F5 AC LODSB
141A:01F6 08C0 OR AL,AL
141A:01F8 7406 JZ 0200
141A:01FA B40E MOV AH,0E
141A:01FC CD10 INT 10
141A:01FE EBF5 JMP 01F5
141A:0200 C3 RET
和100到200
-u 100 200
141A:0100 B8C007 MOV AX,07C0
141A:0103 8ED8 MOV DS,AX
141A:0105 8EC0 MOV ES,AX
141A:0107 BE4F00 MOV SI,004F
141A:010A E8E800 CALL 01F5
141A:010D BE8F00 MOV SI,008F
141A:0110 E8E200 CALL 01F5
141A:0113 BFB500 MOV DI,00B5
141A:0116 E8E800 CALL 0201
141A:0119 BEB500 MOV SI,00B5
141A:011C 803C00 CMP BYTE PTR [SI],00
141A:011F 74EC JZ 010D
141A:0121 BEB500 MOV SI,00B5
141A:0124 BF9100 MOV DI,0091
141A:0127 E81C01 CALL 0246
141A:012A 7213 JB 013F
141A:012C BEB500 MOV SI,00B5
141A:012F BF9400 MOV DI,0094
141A:0132 E81101 CALL 0246
141A:0135 7210 JB 0147
141A:0137 BE7800 MOV SI,0078
141A:013A E8B800 CALL 01F5
141A:013D EBCE JMP 010D
141A:013F BE6300 MOV SI,0063
141A:0142 E8B000 CALL 01F5
141A:0145 EBC6 JMP 010D
141A:0147 BE9900 MOV SI,0099
141A:014A E8A800 CALL 01F5
141A:014D EBBE JMP 010D
141A:014F 57 PUSH DI
141A:0150 65 DB 65
141A:0151 6C DB 6C
141A:0152 63 DB 63
141A:0153 6F DB 6F
141A:0154 6D DB 6D
141A:0155 65 DB 65
141A:0156 20746F AND [SI+6F],DH
141A:0159 204D79 AND [DI+79],CL
141A:015C 204F53 AND [BX+53],CL
141A:015F 210D AND [DI],CX
141A:0161 0A00 OR AL,[BX+SI]
141A:0163 48 DEC AX
141A:0164 65 DB 65
141A:0165 6C DB 6C
141A:0166 6C DB 6C
141A:0167 6F DB 6F
141A:0168 204F53 AND [BX+53],CL
141A:016B 44 INC SP
141A:016C 65 DB 65
141A:016D 7620 JBE 018F
141A:016F 57 PUSH DI
141A:0170 6F DB 6F
141A:0171 726C JB 01DF
141A:0173 64 DB 64
141A:0174 210D AND [DI],CX
141A:0176 0A00 OR AL,[BX+SI]
141A:0178 42 INC DX
141A:0179 61 DB 61
141A:017A 64 DB 64
141A:017B 20636F AND [BP+DI+6F],AH
141A:017E 6D DB 6D
141A:017F 6D DB 6D
141A:0180 61 DB 61
141A:0181 6E DB 6E
141A:0182 64 DB 64
141A:0183 20656E AND [DI+6E],AH
141A:0186 7465 JZ 01ED
141A:0188 7265 JB 01EF
141A:018A 64 DB 64
141A:018B 2E CS:
141A:018C 0D0A00 OR AX,000A
141A:018F 3E DS:
141A:0190 006869 ADD [BX+SI+69],CH
141A:0193 006865 ADD [BX+SI+65],CH
141A:0196 6C DB 6C
141A:0197 7000 JO 0199
141A:0199 4D DEC BP
141A:019A 7920 JNS 01BC
141A:019C 4F DEC DI
141A:019D 53 PUSH BX
141A:019E 3A20 CMP AH,[BX+SI]
141A:01A0 43 INC BX
141A:01A1 6F DB 6F
141A:01A2 6D DB 6D
141A:01A3 6D DB 6D
141A:01A4 61 DB 61
141A:01A5 6E DB 6E
141A:01A6 64 DB 64
141A:01A7 733A JNB 01E3
141A:01A9 206869 AND [BX+SI+69],CH
141A:01AC 2C20 SUB AL,20
141A:01AE 68 DB 68
141A:01AF 65 DB 65
141A:01B0 6C DB 6C
141A:01B1 700D JO 01C0
141A:01B3 0A00 OR AL,[BX+SI]
141A:01B5 0000 ADD [BX+SI],AL
141A:01B7 0000 ADD [BX+SI],AL
141A:01B9 0000 ADD [BX+SI],AL
141A:01BB 0000 ADD [BX+SI],AL
141A:01BD 0000 ADD [BX+SI],AL
141A:01BF 0000 ADD [BX+SI],AL
141A:01C1 0000 ADD [BX+SI],AL
141A:01C3 0000 ADD [BX+SI],AL
141A:01C5 0000 ADD [BX+SI],AL
141A:01C7 0000 ADD [BX+SI],AL
141A:01C9 0000 ADD [BX+SI],AL
141A:01CB 0000 ADD [BX+SI],AL
141A:01CD 0000 ADD [BX+SI],AL
141A:01CF 0000 ADD [BX+SI],AL
141A:01D1 0000 ADD [BX+SI],AL
141A:01D3 0000 ADD [BX+SI],AL
141A:01D5 0000 ADD [BX+SI],AL
141A:01D7 0000 ADD [BX+SI],AL
141A:01D9 0000 ADD [BX+SI],AL
141A:01DB 0000 ADD [BX+SI],AL
141A:01DD 0000 ADD [BX+SI],AL
141A:01DF 0000 ADD [BX+SI],AL
141A:01E1 0000 ADD [BX+SI],AL
141A:01E3 0000 ADD [BX+SI],AL
141A:01E5 0000 ADD [BX+SI],AL
141A:01E7 0000 ADD [BX+SI],AL
141A:01E9 0000 ADD [BX+SI],AL
141A:01EB 0000 ADD [BX+SI],AL
141A:01ED 0000 ADD [BX+SI],AL
141A:01EF 0000 ADD [BX+SI],AL
141A:01F1 0000 ADD [BX+SI],AL
141A:01F3 0000 ADD [BX+SI],AL
141A:01F5 AC LODSB
141A:01F6 08C0 OR AL,AL
141A:01F8 7406 JZ 0200
141A:01FA B40E MOV AH,0E
141A:01FC CD10 INT 10
141A:01FE EBF5 JMP 01F5
141A:0200 C3 RET
我需要刻录此代码,但我的原始代码位于100&之间。 200 ..
ds有点: -
-d 0 200
141A:0000 CD 20 FF 9F 00 9A EE FE-1D F0 4F 03 7E 0E 8A 03 . ........O.~...
141A:0010 7E 0E 17 03 7E 0E 29 04-03 04 01 00 02 FF FF FF ~...~.).........
141A:0020 FF FF FF FF FF FF FF FF-FF FF FF FF E4 0D 4E 01 ..............N.
141A:0030 3E 13 14 00 18 00 1A 14-FF FF FF FF 00 00 00 00 >...............
141A:0040 05 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
141A:0050 CD 21 CB 00 00 00 00 00-00 00 00 00 00 20 20 20 .!...........
141A:0060 20 20 20 20 20 20 20 20-00 00 00 00 00 20 20 20 .....
141A:0070 20 20 20 20 20 20 20 20-00 00 00 00 00 00 00 00 ........
141A:0080 01 20 0D 65 72 6E 65 6C-2E 62 69 6E 20 0D 20 49 . .ernel.bin . I
141A:0090 35 20 44 31 20 50 33 33-30 20 54 33 0D 74 2E 65 5 D1 P330 T3.t.e
141A:00A0 78 65 0D 00 00 00 00 00-00 00 00 00 00 00 00 00 xe..............
141A:00B0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
141A:00C0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
141A:00D0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
141A:00E0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
141A:00F0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
141A:0100 B8 C0 07 8E D8 8E C0 BE-4F 00 E8 E8 00 BE 8F 00 ........O.......
141A:0110 E8 E2 00 BF B5 00 E8 E8-00 BE B5 00 80 3C 00 74 .............<.t
141A:0120 EC BE B5 00 BF 91 00 E8-1C 01 72 13 BE B5 00 BF ..........r.....
141A:0130 94 00 E8 11 01 72 10 BE-78 00 E8 B8 00 EB CE BE .....r..x.......
141A:0140 63 00 E8 B0 00 EB C6 BE-99 00 E8 A8 00 EB BE 57 c..............W
141A:0150 65 6C 63 6F 6D 65 20 74-6F 20 4D 79 20 4F 53 21 elcome to My OS!
141A:0160 0D 0A 00 48 65 6C 6C 6F-20 4F 53 44 65 76 20 57 ...Hello OSDev W
141A:0170 6F 72 6C 64 21 0D 0A 00-42 61 64 20 63 6F 6D 6D orld!...Bad comm
141A:0180 61 6E 64 20 65 6E 74 65-72 65 64 2E 0D 0A 00 3E and entered....>
141A:0190 00 68 69 00 68 65 6C 70-00 4D 79 20 4F 53 3A 20 .hi.help.My OS:
141A:01A0 43 6F 6D 6D 61 6E 64 73-3A 20 68 69 2C 20 68 65 Commands: hi, he
141A:01B0 6C 70 0D 0A 00 00 00 00-00 00 00 00 00 00 00 00 lp..............
141A:01C0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
141A:01D0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
141A:01E0 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
141A:01F0 00 00 00 00 00 AC 08 C0-74 06 B4 0E CD 10 EB F5 ........t.......
141A:0200 C3 .
答案 0 :(得分:2)
没有标题;这是DOS DEBUG.COM
伪造内存,因此地址0000到0100与DOS程序段前缀匹配。
如果您在十六进制编辑器中查看文件,那么您应该看到第一个字节是B8 C0 07...
。