📄 gets.asm
字号:
;--------------------------------------------------------; File Created by SDCC : FreeWare ANSI-C Compiler; Version 2.3.0 Thu Sep 20 10:57:49 2001;-------------------------------------------------------- .module gets ;--------------------------------------------------------; Public variables in this module;-------------------------------------------------------- .globl _gets;--------------------------------------------------------; special function registers;--------------------------------------------------------;--------------------------------------------------------; special function bits ;--------------------------------------------------------;--------------------------------------------------------; internal ram data;-------------------------------------------------------- .area _DATA;--------------------------------------------------------; overlayable items in internal ram ;-------------------------------------------------------- .area _OVERLAY;--------------------------------------------------------; indirectly addressable internal ram data;-------------------------------------------------------- .area _ISEG;--------------------------------------------------------; bit data;-------------------------------------------------------- .area _BSEG;--------------------------------------------------------; external ram data;-------------------------------------------------------- .area _XSEG;--------------------------------------------------------; global & static initialisations;-------------------------------------------------------- .area _GSINIT .area _GSFINAL .area _GSINIT;--------------------------------------------------------; Home;-------------------------------------------------------- .area _HOME .area _CODE;--------------------------------------------------------; code;-------------------------------------------------------- .area _CODE; gets.c 3; genLabel; genFunction; ---------------------------------; Function gets; ---------------------------------___gets_start:_gets: push ix ld ix,#0 add ix,sp ld hl,#-2 add hl,sp ld sp,hl; gets.c 5; genAssign; AOP_STK for _gets_count_1_1 ld -2(ix),#0x00 ld -1(ix),#0x00; gets.c 7; genLabel00109$:; gets.c 8; genCall; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 call _getchar ld e,l; gets.c 9; genCmpEq; genCmpEq: left 1, right 1, result 0 ld a,e cp a,#0x08; Rule 5: Changed jump logic jp z,00103$00118$:; genCmpEq; genCmpEq: left 1, right 1, result 0 ld a,e cp a,#0x0A; Rule 5: Changed jump logic jp z,00104$00119$:; genCmpEq; genCmpEq: left 1, right 1, result 0 ld a,e cp a,#0x0D; Rule 5: Changed jump logic jp z,00104$00120$:; genGoto jp 00106$; gets.c 18; genLabel00103$:; gets.c 11; genIfx; AOP_STK for _gets_count_1_1 ld a,-2(ix); Rule 8: Removed redundent or for (ix) or a,-1(ix) jp z,00109$; gets.c 12; genIpush; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 push de ld a,#0x08 push af inc sp; genCall call _putchar inc sp pop hl ld e,l; gets.c 13; genIpush; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 push de ld a,#0x20 push af inc sp; genCall call _putchar inc sp pop hl ld e,l; gets.c 14; genIpush; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 push de ld a,#0x08 push af inc sp; genCall call _putchar inc sp pop hl ld e,l; gets.c 15; genAssign; AOP_STK for ld d,4(ix) ld c,5(ix); genMinus; AOP_STK for ld a,d add a,#0xFF ld 4(ix),a ld a,c adc a,#0xFF ld 5(ix),a; gets.c 16; genMinus; AOP_STK for _gets_count_1_1 ld l,-2(ix) ld h,-1(ix) dec hl ld a,l ld d,h ld -2(ix),a ld -1(ix),d; gets.c 18; genGoto jp 00109$; gets.c 21; genLabel00104$:; genIpush; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 push de ld a,#0x0D push af inc sp; genCall call _putchar inc sp pop hl ld e,l; gets.c 22; genIpush; _saveRegsForCall: sendSetSize: 0 deInUse: 1 bcInUse: 0 deSending: 0 push de ld a,#0x0A push af inc sp; genCall call _putchar inc sp pop hl ld e,l; gets.c 23; genAssign; AOP_STK for ld c,4(ix) ld b,5(ix); genAssign (pointer) ld a,#0x00 ld (bc),a; gets.c 24; genRet ld l,c ld h,b jp 00111$; gets.c 26; genLabel00106$:; genAssign; AOP_STK for ld c,4(ix) ld b,5(ix); genAssign (pointer) ld a,e ld (bc),a; genPlus; AOP_STK for ; genPlusIncr; Can't optimise plus by inc, falling back to the normal way ld a,c add a,#0x01 ld 4(ix),a ld a,b adc a,#0x00 ld 5(ix),a; gets.c 27; genPlus; AOP_STK for _gets_count_1_1; genPlusIncr inc -2(ix) jp nz,00121$ inc -1(ix)00121$:; gets.c 28; genIpush; _saveRegsForCall: sendSetSize: 0 deInUse: 0 bcInUse: 0 deSending: 0 ld a,e push af inc sp; genCall call _putchar inc sp; gets.c 30; genGoto jp 00109$; genLabel00111$:; genEndFunction ld sp,ix pop ix ret___gets_end: .area _CODE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -