Just started to learn assembler, gave a laboratory, the task is
In the data segment, the following numbers are placed: -1, 2, + 128,129, + 32769 in the minimum format necessary for them. Expand the first two numbers to the format of the word and write down after the original numbers. ON THE PLACE OF THE SENIOR BYTE THIRD NUMBER RECORD THE SYMBOL '#', ON THE PLACE OF THE YOUNGER BYTE - THE SYMBOL '1'.
The problem is that I do not know how to turn to the 3rd number (maybe I did it). Here is my code, it even started (tasm / tlink / tb).
.386 dseg segment use16 a db -1 b db 2 Ρ dw +128 d dd +32769 dseg ends ;ΠΠΠΠΠ‘ΠΠ eseg segment use16 ea dw ? eb dd ? ec dd ? ed dd ? eseg ends cseg segment use16 assume ds:dseg, cs:cseg ; Π·Π°Π³ΡΡΠ·ΠΊΠ° ΡΠ΅Π³ΠΈΡΡΡΠΎΠ²-ΡΠΊΠ°Π·Π°ΡΠ΅Π»ΠΉ ΡΠ΅Π³ΠΌΠ΅Π½ΡΠΎΠ² ds ΠΈ es m1: mov cx, dseg mov ds, cx mov cx, cseg mov es, cx ; ΡΠ°ΡΡΠΈΡΠΈΠΌ ΠΏΠ΅ΡΠ²ΡΠ΅ Π΄Π²Π° ΡΠΈΡΠ»Π° Π΄ΠΎ ΡΠΎΡΠΌΠ°ΡΠ° ΡΠ»ΠΎΠ²Π°, Π·Π°ΠΏΠΈΡΠ΅ΠΌ Π² es:ea movzx ax, ds:a movzx bx, ds:b mov es:ea, ax mov es:eb, bx ; ΠΠ°ΠΌΠ΅Π½ΠΈΠΌ 3 ΡΠΈΡΠ»ΠΎ ΠΌΠ°ΠΊΡΠΈΠΌΡΠΌ Π½Π° ΡΠ΅ΡΠ΅ΡΠΊΡ, ΠΌΠΈΠ½ΠΈΠΌΡΠΌ Π½Π° 1 lea esi,d mov [esi], byte ptr '1' add esi,3 mov [esi], byte ptr '#' ; ΠΠ°Π²Π΅ΡΡΠ΅Π½ΠΈΠ΅ ΠΈΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ mov ah, 4ch int 21h cseg ends end m1
mov eax, '#'operation, you enter the grid code in the low byte of the ax register, resetting the previous value. If you want to place the grid in the high byte eax, then after moving the grid code, you need to cycle the bits to the left. - Komdosh