Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 1.03 KB

dot_gotosw.md

File metadata and controls

49 lines (37 loc) · 1.03 KB

Asmc Macro Assembler Reference

.GOTOSW

.GOTOSW [[([[n:]]<case_val>)] | [.IF condition]]

Generates code to jump to the top of a .SWITCH block if condition is true.

.GOTOSW jump's directly to the TEST label.

.switch al
  .case 1
  ...
  .case 9
    mov al,1
    .gotosw		; "Jump" to case 1

GOTOSW(n:) is optional nesting level to continue.

.switch al
  .case 1
    .gotosw		; continue .switch al
    .switch bl
      .case 1
	.gotosw(1:)	; continue .switch al
	.switch cl
	  .case 1
	    .gotosw(2:) ; continue .switch al
	    .switch dl
	      .case 1
		.gotosw(3:) ; continue .switch al
		.gotosw(2:) ; continue .switch bl
		.gotosw(1:) ; continue .switch cl
		;
		; Direct jump to .switch cl / case 1
		;
		.gotosw(1:1)
	    .endsw
	.endsw
    .endsw
.endsw

GOTOSW can be used in combination with .IF condition, or a direct jump to .GOTOSW(<case_val>).

See Also

Directives Reference | .ENDC | .SWITCH