Показать сообщение отдельно
Старый 20.10.2002, 13:52     # 4
helldomain
Administrator
 
Аватар для helldomain
 
Регистрация: 13.05.2002
Сообщения: 11 227

helldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиург
helldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиургhelldomain Демиург
Pochemu strannij?

Es:[Bx+15h] znachit, chto iskomaya yacheika pamyati nahoditsya po adresu: segment Es, ofset - soderjimoe registra Bx plius 15 w schesnadcaterichnoi. Esli ti imeesh w widu, gde eto mojet ispolzowatsya, to kak minimum pri obrabotke strok. Dopustim tebe nado prewratit kajduju strochnuju bukwu stroki w propisnuju.

Segment s dannimi:
DSeg Segment
DummyData dw 1 dup (?) ;Prosto zabiwaem perwie dwa baita segmenta kakoi-to hrenju
MyStr db 'wot tebe stroka' ;Dalshe pishem stroku. Ee adres budet propisan kak metka "MyStr"
DSeg EndS

Segment koda:
CSeg Segment

; Eto procedura
Main Proc
;Zdes idet inicializaciya segmentow i prochaya hren
Mov Cx, 15 ; Eto dlina stroki w baitah
@MainByteScanLoop: ; Eto metka na kotoruju polzet loop
;Berem odin bait iz stroki i kidaem ego w registr Dl.
;Snachala nado skopirowat Cx (peremennaya cikla, indeks w registr kotorij mojno ispolzowat dlya adresacii. Eto mogut bit Bx, Si, Di)
Mov Bx, Cx
;Teper chitaem baitik po izwestnomu adresu ;-))) i kidaem ego w Dl
Mov Dl, Ds:[Bx+2]
;Zdes ti pishesh swoju obrabotku znaka stroki. Rezultat kladesh w Dl.
____________TWOI_KOD___________
;Kidaem ego obratno tuda, otkuda wzyali
Mov Ds:[Bx+2], Dl

;Operand zawersheniya cikla. Emu dajetsya metka prijka
Loop @MainByteScanLoop
Main EndP

CSeg EndS
__________________
Осколки прошлого, как снег, закрутит ураган времён,
В ушедший день для нас навек, обрушив мост,
Оставив в наших душах след, тьма уплывёт за горизонт,
И в чистом небе вспыхнет свет, свет новых звёзд.
helldomain вне форума