---
---
> call .Asc ; -> CF Input old string pop si cx ;(2) jc .i ???
call .Asc ; -> CF Input old string
> .s0E: call .DelSel ; -> CF jc .s0E_1 ???
pop si cx ;(2)
jc .i ???
> .s53: call .DelSel ; -> CF jnc .Del ret ???
.s0E: call .DelSel ; -> CF
> call .Asc ; -> CF Input an history string pop bx ;(7) jc .s48_5 ???
jc .s0E_1 ???
> call .Asc ; -> CF Input the clipboard string pop si ;(8) jc .s2F_3 ???
.s53: call .DelSel ; -> CF
jnc .Del
ret ???
call .Asc ; -> CF Input an history string
pop bx ;(7)
jc .s48_5 ???
call .Asc ; -> CF Input the clipboard string
pop si ;(8)
jc .s2F_3 ???
---
> and cx, 0FF01h ;Strip flag bits
and cx, 0FF01h ;Strip flag bits
---
> .NoSel: and word [bp-10], -3 ;FLAGS.Selection OFF
.NoSel: and word [bp-10], -3 ;FLAGS.Selection OFF
---
> Did I include enough (Windows style) features to rightfully call this procedure "Rich Edit" ?
Did I include enough (Windows style) features to rightfully call this procedure "Rich Edit" ?
---
> Since I program for DOS, I can't afford to waste memory. I tried to write the shortest code possible, but perhaps someone else could suggest additional code size reductions?
Since I program for DOS, I can't afford to waste memory. I tried to write the shortest code possible, but perhaps someone else could suggest additional code size reductions?
---
> The current code uses a lot of memory transfers (buffer to buffer). I would like these to be as fast as possible, but I don't want the code size to increase. Kind of a dilemma but maybe a seasoned programmer can find a way out?
The current code uses a lot of memory transfers (buffer to buffer). I would like these to be as fast as possible, but I don't want the code size to increase. Kind of a dilemma but maybe a seasoned programmer can find a way out?
---
---
> call .Asc ; -> CF Input old string pop si cx ;(2) jc .i ???
> .s0E: call .DelSel ; -> CF jc .s0E_1 ???
> .s53: call .DelSel ; -> CF jnc .Del ret ???
> call .Asc ; -> CF Input an history string pop bx ;(7) jc .s48_5 ???
> call .Asc ; -> CF Input the clipboard string pop si ;(8) jc .s2F_3 ???
---
> and cx, 0FF01h ;Strip flag bits
---
> .NoSel: and word [bp-10], -3 ;FLAGS.Selection OFF
---
> Did I include enough (Windows style) features to rightfully call this procedure "Rich Edit" ?
---
> Since I program for DOS, I can't afford to waste memory. I tried to write the shortest code possible, but perhaps someone else could suggest additional code size reductions?
---
> The current code uses a lot of memory transfers (buffer to buffer). I would like these to be as fast as possible, but I don't want the code size to increase. Kind of a dilemma but maybe a seasoned programmer can find a way out?
call .Asc ; -> CF Input old string
pop si cx ;(2)
jc .i ???
.s0E: call .DelSel ; -> CF
jc .s0E_1 ???
.s53: call .DelSel ; -> CF
jnc .Del
ret ???
call .Asc ; -> CF Input an history string
pop bx ;(7)
jc .s48_5 ???
call .Asc ; -> CF Input the clipboard string
pop si ;(8)
jc .s2F_3 ???
and cx, 0FF01h ;Strip flag bits
.NoSel: and word [bp-10], -3 ;FLAGS.Selection OFF
Did I include enough (Windows style) features to rightfully call this procedure "Rich Edit" ?
Since I program for DOS, I can't afford to waste memory. I tried to write the shortest code possible, but perhaps someone else could suggest additional code size reductions?
The current code uses a lot of memory transfers (buffer to buffer). I would like these to be as fast as possible, but I don't want the code size to increase. Kind of a dilemma but maybe a seasoned programmer can find a way out?
Parameter errors
### Parameters in registers---
### Commenting CF---
call .Asc ; -> CF Input old string pop si cx ;(2) jc .i ???
> call .Asc ; -> CF Input old string pop si cx ;(2) jc .i ???
.s0E: call .DelSel ; -> CF jc .s0E_1 ???
> .s0E: call .DelSel ; -> CF jc .s0E_1 ???
.s53: call .DelSel ; -> CF jnc .Del ret ???
> .s53: call .DelSel ; -> CF jnc .Del ret ???
call .Asc ; -> CF Input an history string pop bx ;(7) jc .s48_5 ???
> call .Asc ; -> CF Input an history string pop bx ;(7) jc .s48_5 ???
call .Asc ; -> CF Input the clipboard string pop si ;(8) jc .s2F_3 ???
> call .Asc ; -> CF Input the clipboard string pop si ;(8) jc .s2F_3 ???
Bit flags
---
> and and cx, 0FF01h ;Strip flag bits
### Explicit flag masks---
and word [bp-10], 1111'1111'1111'1101b
and word [bp-10], 0FFFDh
and word [bp-10], not 2
and word [bp-10], 1111'1111'1111'1101b
and word [bp-10], 0FFFDh
and word [bp-10], not 2
Answering your questions
---
Answering your questions
---
> Since I program for DOS, I can't afford to waste memory. I tried to write the shortest code possible, but perhaps someone else could suggest additional code size reductions?
You can shave off 1 byte in the sequence mov al, [bp-8]
cmp al, [bp-7]
.
Read both variables in AX
(mov ax, [bp-8]
), then compare both register halves (cmp al, ah
).
---
Parameter errors
### Parameters in registers
### Commenting CF
call .Asc ; -> CF Input old string pop si cx ;(2) jc .i ???
.s0E: call .DelSel ; -> CF jc .s0E_1 ???
.s53: call .DelSel ; -> CF jnc .Del ret ???
call .Asc ; -> CF Input an history string pop bx ;(7) jc .s48_5 ???
call .Asc ; -> CF Input the clipboard string pop si ;(8) jc .s2F_3 ???
Bit flags
> and cx, 0FF01h ;Strip flag bits
### Explicit flag masks
and word [bp-10], 1111'1111'1111'1101b
and word [bp-10], 0FFFDh
and word [bp-10], not 2
Answering your questions
> Since I program for DOS, I can't afford to waste memory. I tried to write the shortest code possible, but perhaps someone else could suggest additional code size reductions?
You can shave off 1 byte in the sequence mov al, [bp-8]
cmp al, [bp-7]
.
Read both variables in AX
(mov ax, [bp-8]
), then compare both register halves (cmp al, ah
).
---
---
> call .Asc ; -> CF Input old string pop si cx ;(2) jc .i ???
> .s0E: call .DelSel ; -> CF jc .s0E_1 ???
> .s53: call .DelSel ; -> CF jnc .Del ret ???
> call .Asc ; -> CF Input an history string pop bx ;(7) jc .s48_5 ???
> call .Asc ; -> CF Input the clipboard string pop si ;(8) jc .s2F_3 ???
---
> and cx, 0FF01h ;Strip flag bits
---
and word [bp-10], 1111'1111'1111'1101b
and word [bp-10], 0FFFDh
and word [bp-10], not 2
---
Answering your questions
---
> Since I program for DOS, I can't afford to waste memory. I tried to write the shortest code possible, but perhaps someone else could suggest additional code size reductions?
You can shave off 1 byte in the sequence mov al, [bp-8]
cmp al, [bp-7]
.
Read both variables in AX
(mov ax, [bp-8]
), then compare both register halves (cmp al, ah
).
---
Parameter errors
--- ### Parameters in registers
--- ### Commenting CF
Bit flags
--- ### Explicit flag masks
---
Answering your questions
Answering your questions
I could definitely say this is indeed "Rich Edit". There's but one feature that I feel is missing. Why didn't you implement the insert/overwrite mode for adding characters?
---
You can shave off 1 byte in the sequence mov al, [bp-8]
cmp al, [bp-7]
.
Read both variables in AX
(mov ax, [bp-8]
), then compare both register halves (cmp al, ah
).
---
---
---
---
---
Answering your questions
I could definitely say this is indeed "Rich Edit". There's but one feature that I feel is missing. Why didn't you implement the insert/overwrite mode for adding characters?
---
You can shave off 1 byte in the sequence mov al, [bp-8]
cmp al, [bp-7]
.
Read both variables in AX
(mov ax, [bp-8]
), then compare both register halves (cmp al, ah
).
---
Parameter errors
### Parameters in registers
### Commenting CF
Bit flags
### Explicit flag masks
Answering your questions
I could definitely say this is indeed "Rich Edit". There's but one feature that I feel is missing. Why didn't you implement the insert/overwrite mode for adding characters?
You can shave off 1 byte in the sequence mov al, [bp-8]
cmp al, [bp-7]
.
Read both variables in AX
(mov ax, [bp-8]
), then compare both register halves (cmp al, ah
).
- 98.1k
- 17
- 219
- 419