←back to thread

51 points shakna | 1 comments | | HN request time: 0.311s | source
Show context
russellbeattie ◴[] No.43801120[source]
Browsing the code, I've never seen this form of goto:

   GOTO(1100,1004,1013,1020,1004,1004)(IKIND+1)
I just looked it up. It's a multi-way branch: GOTO(label_1, label_2, label_3, etc.), integer_expression.

If the integer value is 1 (not zero), control flow transfers to label_1, if the value is 2, it transfers to the second label, etc.

Interesting! It's like a simplified switch statement.

replies(3): >>43801211 #>>43801338 #>>43801865 #
1. mayank ◴[] No.43801211[source]
Indeed! It’s a form of a branch table: https://en.m.wikipedia.org/wiki/Branch_table