mirror of
https://github.com/cc65/cc65.git
synced 2024-09-06 18:54:30 +00:00
Check for shift count zero
git-svn-id: svn://svn.cc65.org/cc65/trunk@1055 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
03229b3253
commit
43530d1604
@ -2848,12 +2848,11 @@ void g_asr (unsigned flags, unsigned long val)
|
|||||||
AddCodeLine ("txa");
|
AddCodeLine ("txa");
|
||||||
ldxconst (0);
|
ldxconst (0);
|
||||||
val -= 8;
|
val -= 8;
|
||||||
|
}
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
/* Done */
|
/* Done */
|
||||||
return;
|
return;
|
||||||
}
|
} else if (val >= 1 && val <= 4) {
|
||||||
}
|
|
||||||
if (val >= 1 && val <= 4) {
|
|
||||||
if (flags & CF_UNSIGNED) {
|
if (flags & CF_UNSIGNED) {
|
||||||
AddCodeLine ("jsr shrax%ld", val);
|
AddCodeLine ("jsr shrax%ld", val);
|
||||||
} else {
|
} else {
|
||||||
@ -2864,7 +2863,10 @@ void g_asr (unsigned flags, unsigned long val)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CF_LONG:
|
case CF_LONG:
|
||||||
if (val >= 1 && val <= 4) {
|
if (val == 0) {
|
||||||
|
/* Nothing to do */
|
||||||
|
return;
|
||||||
|
} else if (val >= 1 && val <= 4) {
|
||||||
if (flags & CF_UNSIGNED) {
|
if (flags & CF_UNSIGNED) {
|
||||||
AddCodeLine ("jsr shreax%ld", val);
|
AddCodeLine ("jsr shreax%ld", val);
|
||||||
} else {
|
} else {
|
||||||
@ -2936,12 +2938,11 @@ void g_asl (unsigned flags, unsigned long val)
|
|||||||
AddCodeLine ("tax");
|
AddCodeLine ("tax");
|
||||||
AddCodeLine ("lda #$00");
|
AddCodeLine ("lda #$00");
|
||||||
val -= 8;
|
val -= 8;
|
||||||
|
}
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
/* Done */
|
/* Done */
|
||||||
return;
|
return;
|
||||||
}
|
} else if (val >= 1 && val <= 4) {
|
||||||
}
|
|
||||||
if (val >= 1 && val <= 4) {
|
|
||||||
if (flags & CF_UNSIGNED) {
|
if (flags & CF_UNSIGNED) {
|
||||||
AddCodeLine ("jsr shlax%ld", val);
|
AddCodeLine ("jsr shlax%ld", val);
|
||||||
} else {
|
} else {
|
||||||
@ -2952,7 +2953,10 @@ void g_asl (unsigned flags, unsigned long val)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CF_LONG:
|
case CF_LONG:
|
||||||
if (val >= 1 && val <= 4) {
|
if (val == 0) {
|
||||||
|
/* Nothing to do */
|
||||||
|
return;
|
||||||
|
} else if (val >= 1 && val <= 4) {
|
||||||
if (flags & CF_UNSIGNED) {
|
if (flags & CF_UNSIGNED) {
|
||||||
AddCodeLine ("jsr shleax%ld", val);
|
AddCodeLine ("jsr shleax%ld", val);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user