Write global flag

From Unofficial QEdit Wiki Guide
Jump to: navigation, search


Syntax: write_global_flag xxxxxxxx, register1

  • T_Dword = Global flag number to use.
  • Register 1 = The value of this register will be stored to the global flag used.


Used to store the value of a Register to the global flag used.


100:     read_global_flag 00000001, R1 //Stores global flag number 1's value in Register 1. Let's assume this is a new flag Register 1 now = 00000000.
         addi  R1, 00000001 //Adds 1 to register 1.
         jmp  200 //Jumps to function 200.
200:     write_global_flag 00000001, R1 //Makes Register 1's value = the value of the global flag used. Global flag 1 = 00000001.
         jmp  300 //Jumps to function 300.
300:     read_global_flag 00000001, R1 // A 2nd read_global_flag is recommended here to be used for actively updating the value of register 1 in the current quest.

Also see

read_global_flag, addi, jmp, ret